package com.njsf.controller.front;

import com.github.pagehelper.PageInfo;
import com.njsf.pojo.Book;
import com.njsf.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
@RequestMapping("/front")
public class IndexFrontController {

    @Autowired
    private BookService bookService;

<<<<<<< HEAD
    @RequestMapping("/index")
    public String indexView(Map<String,Object> map){
        PageInfo<Book> pageInfo = bookService.getBooks(1, 12, null);
=======

    @RequestMapping("/index")
    public String indexView(Map<String,Object> map){
        PageInfo<Book> pageInfo = bookService.getBooks(1, 12);
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
        map.put("pageInfo",pageInfo);
        return "front/index";
    }

    @RequestMapping("/registeview")
    public String registeView(){
        return "front/regist";
    }

<<<<<<< HEAD
    @RequestMapping("/loginview")
=======
    @RequestMapping(value = {"/loginview", "/"})
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
    public String loginView(){
        return "front/login";
    }

}
